<template>
  <view class="box">
    <view class="ul" v-if="list && list.length !== 0">
      <view class="li" :key="idx" v-for="(item, idx) in list">
        <view class="line">操作内容: {{ item.remark }}</view>
        <view class="line">操作人: {{ item.creatorName || "-" }} </view>
        <view class="line"
          >操作时间:
          {{ $u.timeFormat(item.createDate, "yyyy-mm-dd hh:MM") }}</view
        >
      </view>
    </view>
    <emptyList v-else></emptyList>
  </view>
</template>

<script setup>
import emptyList from "@/components/empty/emptyList.vue";
import { useDetailStore } from "@/store/detail";
import { computed, onBeforeUnmount } from "vue";
const detailStore = useDetailStore();

const list = computed(() => {
  return detailStore.logHistory;
});
onBeforeUnmount(() => {
  detailStore.setLogList([]);
});
</script>

<style lang="scss">
page {
  background-color: #f9f9f9;
  padding-top: 13px;
}

.box {
  margin-top: 10px;

  .ul {
    .li {
      background-color: #fff;
      border-radius: 8px;
      padding: 9px 13px;
      margin: 0 15px 10px;
      box-shadow: 0px 3px 12px 0px rgba(0, 0, 0, 0.05);
      .line {
        font-size: 13px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #4b4e50;
        line-height: 19px;
        margin-bottom: 13px;
        &:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
}
</style>
